//
//  RecommendView.m
//  God_is_a_Girl
//
//  Created by 李继鹏 on 15/9/23.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LJP_RecommendView.h"

@implementation LJP_RecommendView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.backview = [[UIImageView alloc]init];
        self.backview.userInteractionEnabled = YES;
        [self addSubview:self.backview];
        
        self.index_title = [[UILabel alloc]init];
        [self addSubview:self.index_title];
        
        self.popular_place_str = [[UILabel alloc]init];
        [self addSubview:self.popular_place_str];
        
        self.first_day = [[UILabel alloc]init];
        [self addSubview:self.first_day];
        
        self.day_count = [[UILabel alloc]init];
        [self addSubview:self.day_count];
        
        self.view_count = [[UILabel alloc]init];
        [self addSubview:self.view_count];
        
        self.name = [[UILabel alloc]init];
//        [self addSubview:self.name];
        
        self.headview = [[UIImageView alloc]init];
        [self addSubview:self.headview];
        
        
        UIView *view1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        view1.backgroundColor = [UIColor colorWithRed:0/255.0f green:0/255.0f blue:0/255.0f alpha:0.4];
        [self.backview addSubview:view1];
    }
    
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat w = self.frame.size.width;
    CGFloat h = self.frame.size.height;
    
    self.backview.frame = CGRectMake(0, 0, w, h);
    self.index_title.frame = CGRectMake(w *0.05 , h/10, w -20, h/3);
    [self.index_title setFont:[UIFont fontWithName:@"Helvetica-Bold" size:22]];
    [self.index_title setFont:[UIFont fontWithName:@"Helvetica-BoldOblique" size:22]];
    self.index_title.textColor = [UIColor whiteColor];
    self.index_title.shadowOffset = CGSizeMake(2.5,2.5);
    self.index_title.numberOfLines = 0;//换行
    self.popular_place_str.frame = CGRectMake(w *0.05, h/9+60, w , h/10);
    self.popular_place_str.textColor = [UIColor whiteColor];
    [self.popular_place_str setFont:[UIFont fontWithName:@"Helvetica-Bold" size:19]];
    self.headview.frame = CGRectMake(w - w/10 - 20 , h - w/10 - 20 , w/10, w/10);
    self.headview.layer.cornerRadius = 5;
    self.headview.layer.masksToBounds = YES;
    self.headview.layer.borderWidth = 1.5;
    self.headview.layer.borderColor = [UIColor whiteColor].CGColor;
    
    self.name.frame = CGRectMake(w - 70 , h/3 +80 , w/6, h/6);
    self.name.textColor = [UIColor whiteColor];
    [self.name setFont:[UIFont fontWithName:@"Helvetica-Bold" size:10]];
    
    self.first_day.frame = CGRectMake(w *0.05, h/3+70, w/4, h/6);
    self.first_day.textColor = [UIColor whiteColor];
    [self.first_day setFont:[UIFont fontWithName:@"Helvetica-Bold" size:11]];
    
    self.day_count.frame = CGRectMake(w*0.3 + 10 , h/3+70, w/6 , h/6);
    self.day_count.textColor = [UIColor whiteColor];
    [self.day_count setFont:[UIFont fontWithName:@"Helvetica-Bold" size:11]];
    
    self.view_count.frame = CGRectMake(w *0.05 + 5, h/3+90, w/5, h/6);
    self.view_count.textColor = [UIColor whiteColor];
    [self.view_count setFont:[UIFont fontWithName:@"Helvetica-Bold" size:10]];
    
    
}


@end
